package com.gaga.console.core.entity.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.gaga.common.tree.INode;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

/**
 * @author liujia
 * @version 1.0
 * @date 2022/7/20 13:24
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DataStandardSubjectVO implements INode {

    private Long id;

    private String name;

    /**
     * 父节点ID
     */
    private Long parentId;

    /**
     * 子孙节点
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<INode> children;

    /**
     * 是否有子孙节点
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Boolean hasChildren;

    @Override
    public List<INode> getChildren() {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        return this.children;
    }
}


